<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditTimeLogTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">

                    <h:outputLabel value="#{bundle.CreateTimeLogLabel_date}" for="date" />
                    <p:calendar value="#{reportsController.current.date}" id="date" showOn="button" />

                    <h:outputLabel value="#{bundle.EditTimeLogLabel_project}" for="project" />
                    <h:selectOneMenu id="project" value="#{reportsController.current.project}" title="#{bundle.EditTimeLogTitle_project}" required="true" requiredMessage="#{bundle.EditTimeLogRequiredMessage_project}">
                        <f:selectItems value="#{projectsController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    
                    <h:outputLabel value="#{bundle.EditTimeLogLabel_workedHours}" for="workedHours" />
                    <h:inputText id="workedHours" value="#{reportsController.current.workedHours}" title="#{bundle.EditTimeLogTitle_workedHours}" required="true" requiredMessage="#{bundle.EditTimeLogRequiredMessage_workedHours}"/>
                    
                </h:panelGrid>
                <h:commandButton action="#{reportsController.update}" type="submit" value="Save"/>
            </h:form>

            <h:form>
                <h:commandButton value="Back to Home" action="/index" type="submit" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
